import java.util.Scanner;

public class Test19 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int i = sc.nextInt();
        int [] arr = new int[i];
        for (int j = 0; j < i; j++) {
            arr[j]=sc.nextInt();
        }
        int maxNum=Integer.MIN_VALUE;
        for (int j = 0; j < arr.length; j++) {
             if (arr[j]>maxNum){
                 maxNum=arr[j];
             }
        }
        System.out.println(maxNum);
    }
}
